﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;


namespace Movement_Trajectory_Analysis
{
    
    public partial class CheckForm : Form
    {
        MainForm mainform;
        
        public CheckForm(MainForm mainform)
        {
            
            this.mainform=mainform;
            InitializeComponent();
            label1.Text = "First Hidden Layer: 1";
            label2.Text = "Second Hidden Layer: 1";
           

        }

       
        //1 powloka
        private void trackBar1_Scroll(object sender, EventArgs e)
        {
           
            label1.Text = "First Hidden Layer: " + FirstLayer.Value.ToString();
        }


        //2 powloka 
        private void SecondLayer_Scroll(object sender, EventArgs e)
        {
            
            label2.Text = "Second Hidden Layer: " + SecondLayer.Value.ToString();
        }
        
        

        private void Train_Click(object sender, EventArgs e)
        {
            
                double[,] B = new double[10, 42]; //na razie na sztywno ilosc danych trenujacych
                StreamReader p2 = new StreamReader(@"dane.txt");
                string s1;
                int k = 0;
                while ((s1 = p2.ReadLine()) != null)
                {
                    string[] s2 = s1.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

                    for (int i = 0; i < s2.Length; i++)

                        B[k, i] = Convert.ToDouble(s2[i]);
                    k++;
                }


                double[,] A = new double[1, MTA.temp.Length];
                for (int i = 1; i < MTA.temp.Length; i++)
                {
                    A[0, i] = MTA.temp[i];
                }

                MLP mlp = new MLP(B, A, 100, FirstLayer.Value, SecondLayer.Value, 0, 0, false);
           
        }
    }
}
